import { taskServices } from '@/api';
/**
 * code  refType 1（每日签到）：任务编码，3（课程类型）：章节/环节编码，5（应用）：应用id
 * refType 关联的类型 1、每日签到，3课程类型，5应用
 * @param {*} params
 */
export function commitTask (obj) {
  // 从localStorage获取当前用户所在的年级信息、
  const studentInfo = localStorage.getItem('userInitInfo') ? JSON.parse(localStorage.getItem('userInitInfo')) : { studentGradeCode: '', studentStageCode: '', currentTermCode: '' },
  data = {
    code: obj.catId,
    refType: '3',
    grade: studentInfo.studentGradeCode,
    section: studentInfo.studentStageCode,
    volume: studentInfo.currentTermCode
  };
  taskServices.commitTask(data);
}
